#!/usr/bin/env python3

'''打印指定的excel 文件 只支持xls文件'''

import sys
import xlrd as xl
import xlwt as xlw

fileinput= sys.argv[1]
fileoutput=sys.argv[2]

print ("inputfilepath:",fileinput,"sffsd")
print ("outputfilepath:",fileoutput,"")

idx=1
outworkbook = xlw.Workbook()
outwork_sheet=outworkbook.add_sheet('firstsheet')

exlworkbook = xl.open_workbook(fileinput)
print('shetnames',exlworkbook.sheet_names())
worksheet = exlworkbook.sheet_by_name('firstsheet')
for rowidx in range(worksheet.nrows):
	print('idx:',idx,end=' ')
	for colidx in range (worksheet.ncols):
	    print(worksheet.cell_value(rowidx,colidx),end=' ')
	    outwork_sheet.write(rowidx,colidx,worksheet.cell_value(rowidx,colidx))
	idx=idx+1
	print('\n')
outworkbook.save(fileoutput)
